# notifications/models.py
from django.db import models
from django.contrib.auth import get_user_model

User = get_user_model()

class Notification(models.Model):
    title = models.CharField(max_length=255, verbose_name="标题")
    message = models.TextField(verbose_name="内容")
    users = models.ManyToManyField(User, related_name='notifications', verbose_name="接收用户")
    created_at = models.DateTimeField(auto_now_add=True)
    is_read = models.BooleanField(default=False)

    def __str__(self):
        return self.title
